function Get-ScriptDirectory
{
    $Invocation = (Get-Variable MyInvocation -Scope 1).Value
    Split-Path $Invocation.MyCommand.Path
}

$file = (Get-ScriptDirectory | split-path) + "\Setup\MySQLConfig.xml"
if (Test-Path $file)
   { 
      $x = [xml](get-content $file)
      if ($x.MySQLConfig -eq $null)
         { return $FALSE }
      if ($x.MySQLConfig.host -eq $null -or $x.MySQLConfig.host -eq "")
         { return $FALSE }
      if ($x.MySQLConfig.user -eq $null -or $x.MySQLConfig.user -eq "")
         { return $FALSE }
      $user_name=$x.MySQLConfig.user
      $host_name=$x.MySQLConfig.host
      $user_password=$x.MySQLConfig.pass
   } 
else
   { return $FALSE }
$passwordfile = (Get-ScriptDirectory | split-path) + "\Setup\password.txt"
if (Test-Path $passwordfile)
{
   $secure_password = Get-Content $passwordfile | ConvertTo-SecureString
   $user_password = (New-Object System.Management.Automation.PSCredential('dummy',$secure_password)).GetNetworkCredential().Password 
   $user_password="-p$user_password"
}
$exe="C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe"
$exec_command="use sakila"
& $exe -h $host_name -u $user_name $user_password -e $exec_command
if ($lastexitcode -eq 0)
{
	return $TRUE  
}
return $FALSE